import React from 'react'
import { Routes, Route, Navigate } from 'react-router-dom'
import { ROUTES } from './routes'

// 导入页面组件
import HomePage from '../pages/Home'
import DocumentListPage from '../pages/DocumentList'
import TextEditorPage from '../pages/TextEditor'
import StoryboardPage from '../pages/Storyboard'
import StoryboardProjectPage from '../pages/StoryboardProject'
import StoryboardViewPage from '../pages/StoryboardView'
import DataCollectionPage from '../pages/DataCollection'
import MediaAnalyticsPage from '../pages/MediaAnalytics'
import HotspotAnalysisPage from '../pages/HotspotAnalysis'

/**
 * 应用路由配置组件
 * 定义所有页面路由，不包含Router包装器
 */
const AppRouter: React.FC = () => {
  return (
    <Routes>
      {/* 默认路由重定向到工作台 */}
      <Route path="/" element={<Navigate to={ROUTES.HOME} replace />} />

      {/* 主要功能页面路由 */}
      <Route path={ROUTES.HOME} element={<HomePage />} />
      <Route path={ROUTES.TEXT_DOCUMENT_LIST} element={<DocumentListPage />} />
      <Route path={ROUTES.TEXT_EDITOR} element={<TextEditorPage />} />
      <Route path={ROUTES.STORYBOARD} element={<StoryboardPage />} />
      <Route path={ROUTES.STORYBOARD_PROJECT} element={<StoryboardProjectPage />} />
      <Route path={ROUTES.STORYBOARD_VIEW} element={<StoryboardViewPage />} />
      <Route path={ROUTES.DATA_COLLECTION} element={<DataCollectionPage />} />
      <Route path={ROUTES.DATA_ANALYTICS} element={<MediaAnalyticsPage />} />
      <Route path={ROUTES.DATA_HOTSPOT} element={<HotspotAnalysisPage />} />

      {/* 404页面 - 重定向到工作台 */}
      <Route path="*" element={<Navigate to={ROUTES.HOME} replace />} />
    </Routes>
  )
}

export default AppRouter